package com.sun.config;

import org.springframework.context.annotation.Configuration;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

@Configuration
@WebFilter
public class TestFilter  implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

        System.out.println("=========请求开始");
        chain.doFilter(request,response);
        System.out.println("========请求结束");
    }

    @Override
    public void destroy() {

    }

    public static void main(String[] args) throws Exception {
//        Class aClass = Class.forName("com.sun.pojo.User");
//        Method method = aClass.getMethod("t1", Map.class);
//        JSONObject jsonObject = new JSONObject();
//        jsonObject.put("k1","v1");
//        Object invoke = method.invoke(aClass.newInstance(), jsonObject);
//        System.out.println(invoke);
        Map map = new HashMap();
        map.put("k1","v1");
        Object[] o = new Object[]{map,"987"};
        for (Object o1 : o) {
            System.out.println(String.valueOf(o1));
        }

    }
}
